﻿using Nest;

namespace In66.Net.Elasticsearch
{
    public class ElasticsearchEntity
    {
        [Keyword(Name = "id", Index = false)]
        public string Id => Guid.NewGuid().ToString("N");

        //[Date(Name = "createdAt", Format = "mmddyyyy")]
        //public DateTimeOffset CreatedAt { get; set; } = DateTimeOffset.UtcNow;

        [Number(NumberType.Long, Name = "createdAt")]
        public long CreatedAt=> new DateTimeOffset(DateTime.Now).ToUnixTimeSeconds();
    }
}
